1. /* slfdvhlf.cpp by K.Tsuru */
  2. // function ID = 221 DRADIX, BRADIX
  3. /******************************************************
  4. SLong class
  5. a sub-function for RecursiveKOMult()
  6. It sets the lower half of "x" into "lower" and the upper
  7. half into "upper".
  8. ******************************************************/
  9. #ifndef SN_H
  10. #include "sn.h"
  11. #endif
  12. void SLong::SLDivHalf(const SLong& x, SLong& lower, SLong& upper){
  13. uint half = x.figure.size()/2u;
  14. const fType* xpt = x.ReadFigures();
  15. lower.valloc(half, -1);
  16. memcpy(lower.figure.Elements(), xpt , half*sizeof(fType) );
  17. lower.SetSign(x.Sign());
  18. lower.CheckArray(221);
  19. if(x.Head() < half){
  20. upper.SetZero(); return;
  21. }
  22. upper.valloc(half, -1);
  23. memcpy(upper.figure.Elements(), (xpt+half) , half*sizeof(fType) );
  24. upper.SetSign(x.Sign());
  25. upper.CheckArray(221);
  26. }

slfdvhlf.cpp : last modifiled at 2017/03/13 14:32:00(845 bytes)
created at 2017/10/07 10:26:50
The creation time of this html file is 2017/11/09 14:52:03 (Thu Nov 09 14:52:03 2017).